// f(1) = 1
// f(2) = 2
// f(n) = f(n-2) + f(n-1)
function findIndexFiboncciList(num) {
    let n1 = 1
    let n2 = 1;
    let arr = [1,1]
    let j = 3;// 计数器 第j个
    if(num == 2) return 2
    for(let i = 2; i<=num; i++) {
        // i 不是斐波那契
        if(i = n1 + n2) {
            arr.push(i)
            n1 = arr[j-2]
            n2 = arr[j-1]
            j++
        }
    }
    return arr.indexOf(num)
}
console.log(findIndexFiboncciList(8))